home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / meteorfall.lua < prev    next >
Encoding:
Text File  |  2006-02-27  |  2.1 KB  |  67 lines

  1.  
  2.  
  3. -- meteor description
  4. function effects_meteorfall()
  5.     local meteor = uniGetExecutor()
  6.     local pos = meteor:getWorldPosition()
  7.     local dir = D3DXVECTOR3:new(0.0,-1.0,0.0)
  8.     meteor:setLocalPosition(pos.x - dir.x * 1200,pos.y - dir.y * 1200,pos.z - dir.z * 1200)
  9.     local track = meteor:addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_GREENDEVIL)
  10.     meteor:play3DSound("gd_approach.wav",0)
  11.     waitDeath(meteor:linearFlyD(dir,450))
  12.     dir:delete()
  13.     track:suspendedDestroy(6.0)
  14.     local ht = getHeightType(meteor:getWorldPosition());
  15.  
  16. --    getCamera():shake(1.0,6.0)
  17.     if(ht ~= ENBHT_WATERHIT) then 
  18.         meteor:play3DSound("gd_explode.wav",0)
  19.     end
  20.     -- explosion mark
  21.     if(ht ~= ENBHT_WATERHIT) then
  22.         meteor:play3DSound("air_bomb_waterhit.wav",0)
  23.         local exp_mark = meteor:addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_EXPLOSIONMARK_BIG)
  24.         local exp_ring = meteor:addSimpleEffect(ENET_EFFECT_SP_ENVIRONMENT_EXPLOSION_DEVILRING)
  25.         local exp_exp = meteor:addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_EXPLOSION_DEVILHIT)
  26.         exp_ring:suspendedDestroy(0.8)
  27.         exp_exp:suspendedDestroy(4.0)
  28.         exp_mark:delayedDestroy(70.0)
  29.         exp_mark:setTransformOwner()
  30.     else
  31.         meteor:addSimpleEffect(ENET_EFFECT_PS_BOMB_WATERHIT):suspendedDestroy(2.0)
  32.     end
  33.     pause(3.0)
  34.     meteor:destroy()
  35. end
  36.  
  37. desc = getEffectDescriptionP(ENET_EFFECT_METEORFALL)
  38. desc.onCreate = "effects_meteorfall"
  39. desc.ClassID = ENCLASS_DUMMY
  40. desc.EffectClassType = ENECT_GEOMETRY
  41.  
  42. desc.ScriptSet = ENSCRIPTSET_METEORFALL
  43. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  44. local vzbzd1 = D3DXVECTOR3:new(0,0,0)
  45. desc.LocalPosition = vzbzd1
  46. vzbzd1:delete()
  47.  
  48. desc.MoveType = ENMOVE_FLY
  49.  
  50. desc.ActivityType = ENACT_ACTIVE
  51.  
  52. -- meteors emitter description
  53. desc = getEffectDescriptionP(ENET_EFFECT_METEORSEMITTER)
  54. desc.ClassID = ENCLASS_UNKNOWN
  55. desc.EffectClassType = ENECT_EFFECTSEMITTER
  56. desc.ActivityType = ENACT_ACTIVE
  57.  
  58. desc.ScriptSet = ENSCRIPTSET_UNKNOWN
  59. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  60. local vzbzd2 = D3DXVECTOR3:new(0,0,0)
  61. desc.LocalPosition = vzbzd2
  62. vzbzd2:delete()
  63.  
  64. emitterdesc = desc.EffectsEmitter
  65. emitterdesc.EmitEffectType = ENET_EFFECT_METEORFALL
  66. emitterdesc.EffectsPerSecond = 2
  67.